<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<img id="img">
<script>
    var img = document.getElementById('img');
    img.src = 'http://365jia.cn/uploads/17/0825/599f6dfeaa77d.jpg';
    img.onerror = function(){
        console.log("1")
    } ;
    img.onload = function(){
        console.log("aa")
    };
    img.onprogress = function(){
        console.log("aa")
    };



</script>
</body>
</html>